home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 January / enter-2004-01.iso / files / maxima-5.9.0.exe / {app} / info / maxima.info-2 < prev    next >
Encoding:
GNU Info File  |  2003-02-09  |  49.0 KB  |  1,183 lines

  1. This is maxima.info, produced by makeinfo version 4.1 from maxima.texi.
  2.  
  3.    This is a Texinfo Maxima Manual
  4.  
  5.    Copyright 1994,2001 William F. Schelter
  6.  
  7. START-INFO-DIR-ENTRY
  8. * Maxima: (maxima).     A computer algebra system.
  9. END-INFO-DIR-ENTRY
  10.  
  11. 
  12. File: maxima.info,  Node: Definitions for Operators,  Prev: PREFIX,  Up: Operators
  13.  
  14. Definitions for Operators
  15. =========================
  16.  
  17.  - operator: "!"
  18.      The factorial operator, which is the product of all the integers
  19.      from 1 up to its argument.  Thus 5! = 1*2*3*4*5 = 120.  The value
  20.      of /the option FACTLIM (default: [-1]) gives the highest factorial
  21.      which is automatically expanded.  If it is -1 then all integers
  22.      are expanded.  See also the FACTORIAL, MINFACTORIAL, and FACTCOMB
  23.      commands.
  24.  
  25.  
  26.  - operator: "!!"
  27.      Stands for double factorial which is defined as the product of all
  28.      the consecutive odd (or even) integers from 1 (or 2) to the odd
  29.      (or even) argument.  Thus 8!! is 2*4*6*8 = 384.
  30.  
  31.  
  32.  - operator: "#"
  33.      The logical operator "Not equals".
  34.  
  35.  
  36.  - operator: "."
  37.      The dot operator, for matrix (non-commutative) multiplication.
  38.      When "." is used in this way, spaces should be left on both sides
  39.      of it, e.g. A . B.  This distinguishes it plainly from a decimal
  40.      point in a floating point number.  Do APROPOS(DOT); for a list of
  41.      the switches which affect the dot operator.
  42.      DESCRIBE(switch-name); will explain them.
  43.  
  44.  
  45.  - operator: ":"
  46.      The assignment operator.  E.g. A:3 sets the variable A to 3.
  47.  
  48.  
  49.  - operator: "::"
  50.      Assignment operator.  :: assigns the value of the expression on
  51.      its right to the value of the quantity on its left, which must
  52.      evaluate to an atomic variable or subscripted variable.
  53.  
  54.  
  55.  - operator: "::="
  56.      The "::=" is used instead of ":=" to indicate that what follows is
  57.      a macro definition, rather than an ordinary functional definition.
  58.      See DESCRIBE(MACROS).
  59.  
  60.  
  61.  - operator: ":="
  62.      The function definition operator.  E.g. F(X):=SIN(X) defines a
  63.      function F.
  64.  
  65.  
  66.  - operator: "="
  67.      denotes an equation to MACSYMA.  To the pattern matcher in MACSYMA
  68.      it denotes a total relation that holds between two expressions if
  69.      and only if the expressions are syntactically identical.
  70.  
  71.  
  72.  - Function: ABS (exp)
  73.      returns the absolute value exp.  If exp is complex, returns the
  74.      complex modulus of exp.
  75.  
  76.  
  77.  - special symbol: ADDITIVE
  78.      - If DECLARE(F,ADDITIVE) has been executed, then: (1) If F is
  79.      univariate, whenever the simplifier encounters F applied to a sum,
  80.      F will be distributed over that sum.  I.e. F(Y+X); will simplify
  81.      to F(Y)+F(X).  (2) If F is a function of 2 or more arguments,
  82.      additivity is defined as additivity in the first argument to F, as
  83.      in the case of 'SUM or 'INTEGRATE, i.e. F(H(X)+G(X),X); will
  84.      simplify to F(H(X),X)+F(G(X),X).  This simplification does not
  85.      occur when F is applied to expressions of the form
  86.      SUM(X[I],I,lower-limit,upper-limit).
  87.  
  88.  
  89.  - keyword: ALLBUT
  90.      works with the PART commands (i.e. PART, INPART, SUBSTPART,
  91.      SUBSTINPART, DPART, and LPART).  For example,
  92.  
  93.           if EXPR is E+D+C+B+A,
  94.           then PART(EXPR,[2,5]);
  95.           ==> D+A
  96.  
  97.      while
  98.           PART(EXPR,ALLBUT(2,5))==>E+C+B
  99.  
  100.      It also works with the KILL command,
  101.           KILL(ALLBUT(name1,...,namek))
  102.  
  103.      will do a KILL(ALL) except it will not KILL the names specified.
  104.      Note: namei means a name such as function name such as U, F, FOO,
  105.      or G, not an infolist such as FUNCTIONS.
  106.  
  107.  
  108.  - declaration: ANTISYMMETRIC
  109.      - If DECLARE(H,ANTISYMMETRIC); is done, this tells the simplifier
  110.      that H is antisymmetric.  E.g. H(X,Z,Y) will simplify to - H(X, Y,
  111.      Z).  That is, it will give (-1)^n times the result given by
  112.      SYMMETRIC or COMMUTATIVE, where n is the number of interchanges of
  113.      two arguments necessary to convert it to that form.
  114.  
  115.  
  116.  - Function: CABS (exp)
  117.      returns the complex absolute value (the complex modulus) of exp.
  118.  
  119.  
  120.  - declaration: COMMUTATIVE
  121.      - If DECLARE(H,COMMUTATIVE); is done, this tells the simplifier
  122.      that H is a commutative function.  E.g. H(X,Z,Y) will simplify to
  123.      H(X, Y, Z).  This is the same as SYMMETRIC.
  124.  
  125.  
  126.  - Function: ENTIER (X)
  127.      largest integer <= X where X is numeric.  FIX (as in FIXnum) is a
  128.      synonym for this, so FIX(X); is precisely the same.
  129.  
  130.  
  131.  - Function: EQUAL (expr1,expr2)
  132.      used with an "IS", returns TRUE (or FALSE) if and only if expr1
  133.      and expr2 are equal (or not equal) for all possible values of
  134.      their variables (as determined by RATSIMP).  Thus
  135.      IS(EQUAL((X+1)**2,X**2+2*X+1)) returns TRUE whereas if X is unbound
  136.      IS((X+1)**2=X**2+2*X+1) returns FALSE.  Note also that IS(RAT(0)=0)
  137.      gives FALSE but IS(EQUAL(RAT(0),0)) gives TRUE.  If a determination
  138.      can't be made with EQUAL then a simplified but equivalent form is
  139.      returned whereas = always causes either TRUE or FALSE to be
  140.      returned.  All variables occurring in exp are presumed to be real
  141.      valued.  EV(exp,PRED) is equivalent to IS(exp).
  142.           (C1) IS(X**2 >= 2*X-1);
  143.           (D1)                               TRUE
  144.           (C2) ASSUME(A>1);
  145.           (D2)                               DONE
  146.           (C3) IS(LOG(LOG(A+1)+1)>0 AND A^2+1>2*A);
  147.           (D3)                               TRUE
  148.  
  149.  - Function: EVAL
  150.      causes an extra post-evaluation of exp to occur.
  151.  
  152.  
  153.  - Function: EVENP (exp)
  154.      is TRUE if exp is an even integer.  FALSE is returned in all other
  155.      cases.
  156.  
  157.  
  158.  - Function: FIX (x)
  159.      a synonym for ENTIER(X) - largest integer <= X where X is numeric.
  160.  
  161.  
  162.  - Function: FULLMAP (fn, exp1, ...)
  163.      is similar to MAP but it will keep mapping down all subexpressions
  164.      until the main operators are no longer the same.  The user should
  165.      be aware that FULLMAP is used by the MACSYMA simplifier for
  166.      certain matrix manipulations; thus, the user might see an error
  167.      message concerning FULLMAP even though FULLMAP was not explicitly
  168.      called by the user.
  169.           (C1) A+B*C$
  170.           (C2) FULLMAP(G,%);
  171.           (D2)              G(B) G(C) + G(A)
  172.           (C3)  MAP(G,D1);
  173.           (D3)                G(B C) + G(A)
  174.  
  175.  - Function: FULLMAPL (fn, list1, ...)
  176.      is similar to FULLMAP but it only maps onto lists and matrices
  177.           (C1) FULLMAPL("+",[3,[4,5]],[[A,1],[0,-1.5]]);
  178.           (D1)                      [[A + 3, 4], [4, 3.5]]
  179.  
  180.  - Function: IS (exp)
  181.      attempts to determine whether exp (which must evaluate to a
  182.      predicate) is provable from the facts in the current data base.  IS
  183.      returns TRUE if the predicate is true for all values of its
  184.      variables consistent with the data base and returns FALSE if it is
  185.      false for all such values.  Otherwise, its action depends on the
  186.      setting of the switch PREDERROR (default: TRUE). IS errs out if
  187.      the value of PREDERROR is TRUE and returns UNKNOWN if PREDERROR is
  188.      FALSE.
  189.  
  190.  
  191.  - Function: ISQRT (X)
  192.      takes one integer argument and returns the "integer SQRT" of its
  193.      absolute value.
  194.  
  195.  
  196.  - Function: MAX (X1, X2, ...)
  197.      yields the maximum of its arguments (or returns a simplified form
  198.      if some of its arguments are non-numeric).
  199.  
  200.  
  201.  - Function: MIN (X1, X2, ...)
  202.      yields the minimum of its arguments (or returns a simplified form
  203.      if some of its arguments are non-numeric).
  204.  
  205.  
  206.  - Function: MOD (poly)
  207.      converts the polynomial poly to a modular representation with
  208.      respect to the current modulus which is the value of the variable
  209.      MODULUS.  MOD(poly,m) specifies a MODULUS m to be used for
  210.      converting poly, if it is desired to override the current global
  211.      value of MODULUS.  See DESCRIBE(MODULUS); .
  212.  
  213.  
  214.  - Function: ODDP (exp)
  215.      is TRUE if exp is an odd integer.  FALSE is returned in all other
  216.      cases.
  217.  
  218.  
  219.  - operator: PRED
  220.      (EVFLAG) causes predicates (expressions which evaluate to TRUE or
  221.      FALSE) to be evaluated.
  222.  
  223.  
  224.  - Function: RANDOM (X)
  225.      returns a random integer between 0 and X-1.  If no argument is
  226.      given then a random integer between -2^(29) and 2^(29) -1 is
  227.      returned.  If X is FALSE then the random sequence is restarted from
  228.      the beginning.  Note that the range of the returned result when no
  229.      argument is given differs in NIL MACSYMA from that of PDP-10 and
  230.      Multics MACSYMA, which is -2^(35) to 2^(35) -1.  This range is the
  231.      range of the FIXNUM datatype of the underlying LISP.
  232.  
  233.  
  234.  - Function: SIGN (exp)
  235.      attempts to determine the sign of its specified expression on the
  236.      basis of the facts in the current data base.  It returns one of
  237.      the following answers: POS (positive), NEG (negative), ZERO, PZ
  238.      (positive or zero), NZ (negative or zero), PN (positive or
  239.      negative), or PNZ (positive, negative, or zero, i.e. nothing
  240.      known).
  241.  
  242.  
  243.  - Function: SIGNUM (X)
  244.      if X<0 then -1 else if X>0 then 1 else 0.  If X is not numeric
  245.      then a simplified but equivalent form is returned. For example,
  246.      SIGNUM(-X) gives -SIGNUM(X).
  247.  
  248.  
  249.  - Function: SORT (list,optional-predicate)
  250.      sorts the list using a suitable optional-predicate of two
  251.      arguments (such as "<" or ORDERLESSP).  If the optional-predicate
  252.      is not given, then MACSYMA's built-in ordering predicate is used.
  253.  
  254.  
  255.  - Function: SQRT (X)
  256.      the square root of X. It is represented internally by X^(1/2).
  257.      Also see ROOTSCONTRACT.  RADEXPAND[TRUE] - if TRUE will cause nth
  258.      roots of factors of a product which are powers of n to be pulled
  259.      outside of the radical, e.g.  SQRT(16*X^2) will become 4*X only if
  260.      RADEXPAND is TRUE.
  261.  
  262.  
  263.  - Variable: SQRTDISPFLAG
  264.      default: [TRUE] - if FALSE causes SQRT to display with exponent
  265.      1/2.
  266.  
  267.  
  268.  - Function: SUBLIS (list,expr)
  269.      allows multiple substitutions into an expression in parallel.
  270.      Sample syntax:
  271.                   SUBLIS([A=B,B=A],SIN(A)+COS(B));
  272.                    => SIN(B) + COS(A)
  273.      The variable SUBLIS_APPLY_LAMBDA[TRUE] controls simplification
  274.      after SUBLIS.  For full documentation, see the file SHARE2;SUBLIS
  275.      INFO.
  276.  
  277.  
  278.  - Function: SUBLIST (L,F)
  279.      returns the list of elements of the list L for which the function
  280.      F returns TRUE.  E.g., SUBLIST([1,2,3,4],EVENP); returns [2,4].
  281.  
  282.  
  283.  - Variable: SUBLIS_APPLY_LAMBDA
  284.      default:[TRUE] - controls whether LAMBDA's substituted are applied
  285.      in simplification after SUBLIS is used or whether you have to do
  286.      an EV to get things to apply. TRUE means do the application.
  287.  
  288.  
  289.  - Function: SUBST (a, b, c)
  290.      substitutes a for b in c.  b must be an atom, or a complete
  291.      subexpression of c.  For example, X+Y+Z is a complete
  292.      subexpression of 2*(X+Y+Z)/W while X+Y is not. When b does not have
  293.      these characteristics, one may sometimes use SUBSTPART or RATSUBST
  294.      (see below).  Alternatively, if b is of the form e/f then one could
  295.      use SUBST(a*f,e,c) while if b is of the form e**(1/f) then one
  296.      could use SUBST(a**f,e,c).  The SUBST command also discerns the
  297.      X^Y in X^-Y so that SUBST(A,SQRT(X),1/SQRT(X)) yields 1/A.  a and
  298.      b may also be operators of an expression enclosed in "s or they
  299.      may be function names.  If one wishes to substitute for the
  300.      independent variable in derivative forms then the AT function (see
  301.      below) should be used.  Note:  SUBST is an alias for SUBSTITUTE.
  302.      SUBST(eq1,exp) or SUBST([eq1,...,eqk],exp) are other permissible
  303.      forms.  The eqi are equations indicating substitutions to be made.
  304.      For each equation, the right side will be substituted for the left
  305.      in the expression exp.  EXPTSUBST[FALSE] if TRUE permits
  306.      substitutions like Y for %E**X in %E**(A*X) to take place.
  307.      OPSUBST[TRUE] if FALSE, SUBST will not attempt to substitute into
  308.      the operator of an expression.  E.g. (OPSUBST:FALSE,
  309.      SUBST(X^2,R,R+R[0])); will work.
  310.           (C1) SUBST(A,X+Y,X+(X+Y)**2+Y);
  311.                                            2
  312.           (D1)                    Y + X + A
  313.           (C2) SUBST(-%I,%I,A+B*%I);
  314.           (D2)                             A - %I B
  315.  
  316.      (Note that C2 is one way of obtaining the complex conjugate of an
  317.      analytic expression.)  For further examples, do EXAMPLE(SUBST);
  318.  
  319.  
  320.  - Function: SUBSTINPART (x, exp, n1, ...)
  321.      is like SUBSTPART but works on the internal representation of exp.
  322.           (C1) X.'DIFF(F(X),X,2);
  323.                                              2
  324.                                             d
  325.           (D1)                         X . (--- F(X))
  326.                                               2
  327.                                             dX
  328.           (C2) SUBSTINPART(D**2,%,2);
  329.                                                 2
  330.           (D2)                             X . D
  331.           (C3) SUBSTINPART(F1,F[1](X+1),0);
  332.           (D3)                            F1(X + 1)
  333.                         Additional Information
  334.           If the last argument to a part function is a list of indices then
  335.           several subexpressions are picked out, each one corresponding to an
  336.           index of the list.  Thus
  337.                (C1) PART(X+Y+Z,[1,3]);
  338.                (D1) Z+X
  339.           PIECE holds the value of the last expression selected when using the
  340.           part functions.  It is set during the execution of the function and
  341.           thus may be referred to in the function itself as shown below.
  342.           If PARTSWITCH[FALSE] is set to TRUE then END is returned when a
  343.           selected part of an expression doesn't exist, otherwise an error
  344.           message is given.
  345.           (C1)  27*Y**3+54*X*Y**2+36*X**2*Y+Y+8*X**3+X+1;
  346.                       3         2       2            3
  347.           (D1)    27 Y  + 54 X Y  + 36 X  Y + Y + 8 X  + X + 1
  348.           (C2)  PART(D1,2,[1,3]);
  349.                             2
  350.           (D2)          54 Y
  351.           (C3)  SQRT(PIECE/54);
  352.           (D3)            Y
  353.           (C4)  SUBSTPART(FACTOR(PIECE),D1,[1,2,3,5]);
  354.                                     3
  355.           (D4)           (3 Y + 2 X) + Y + X + 1
  356.           (C5) 1/X+Y/X-1/Z;
  357.                                            1   Y   1
  358.           (D5)                           - - + - + -
  359.                                            Z   X   X
  360.           (C6) SUBSTPART(XTHRU(PIECE),%,[2,3]);
  361.                                           Y + 1   1
  362.           (D6)                            ----- - -
  363.                                             X     Z
  364.      Also, setting the option INFLAG to TRUE and calling PART/SUBSTPART
  365.      is the same as calling INPART/SUBSTINPART.
  366.  
  367.  
  368.  - Function: SUBSTPART (x, exp, n1, ..., nk)
  369.      substitutes x for the subexpression picked out by the rest of the
  370.      arguments as in PART.  It returns the new value of exp.  x may be
  371.      some operator to be substituted for an operator of exp.  In some
  372.      cases it needs to be enclosed in "s (e.g.  SUBSTPART("+",A*B,0);
  373.      -> B + A ).
  374.           (C1) 1/(X**2+2);
  375.                                               1
  376.           (D1)                              ------
  377.                                              2
  378.                                             X  + 2
  379.           (C2) SUBSTPART(3/2,%,2,1,2);
  380.                                               1
  381.           (D2)                             --------
  382.                                             3/2
  383.                                            X    + 2
  384.           (C3) A*X+F(B,Y);
  385.           (D3)                          A X + F(B, Y)
  386.           (C4) SUBSTPART("+",%,1,0);
  387.           (D4)                         X + F(B, Y) + A
  388.      Also, setting the option INFLAG to TRUE and calling PART/SUBSTPART
  389.      is the same as calling INPART/SUBSTINPART.
  390.  
  391.  
  392.  - Function: SUBVARP (exp)
  393.      is TRUE if exp is a subscripted variable, for example A[I].
  394.  
  395.  
  396.  - Function: SYMBOLP (exp)
  397.      returns TRUE if "exp" is a "symbol" or "name", else FALSE.  I.e.,
  398.      in effect, SYMBOLP(X):=ATOM(X) AND NOT NUMBERP(X)$ .
  399.  
  400.  
  401.  - Function: UNORDER ()
  402.      stops the aliasing created by the last use of the ordering
  403.      commands ORDERGREAT and ORDERLESS.  ORDERGREAT and ORDERLESS may
  404.      not be used more than one time each without calling UNORDER.  Do
  405.      DESCRIBE(ORDERGREAT); and DESCRIBE(ORDERLESS);, and also do
  406.      EXAMPLE(UNORDER); for specifics.
  407.  
  408.  
  409.  - Function: VECTORPOTENTIAL (givencurl)
  410.      Returns the vector potential of a given curl vector, in the
  411.      current coordinate system.  POTENTIALZEROLOC has a similar role as
  412.      for POTENTIAL, but the order of the left-hand sides of the
  413.      equations must be a cyclic permutation of the coordinate variables.
  414.  
  415.  
  416.  - Function: XTHRU (exp)
  417.      combines all terms of exp (which should be a sum) over a common
  418.      denominator without expanding products and exponentiated sums as
  419.      RATSIMP does.  XTHRU cancels common factors in the numerator and
  420.      denominator of rational expressions but only if the factors are
  421.      explicit.  Sometimes it is better to use XTHRU before RATSIMPing an
  422.      expression in order to cause explicit factors of the gcd of the
  423.      numerator and denominator to be canceled thus simplifying the
  424.      expression to be RATSIMPed.
  425.           (C1) ((X+2)**20-2*Y)/(X+Y)**20+(X+Y)**-19-X/(X+Y)**20;
  426.                                                           20
  427.                                1           X       (X + 2)   - 2 Y
  428.           (D1)             --------- - --------- + ---------------
  429.                                   19          20             20
  430.                            (Y + X)     (Y + X)        (Y + X)
  431.           (C2) XTHRU(%);
  432.                                                20
  433.                                         (X + 2)   - Y
  434.           (D2)                          -------------
  435.                                                  20
  436.                                           (Y + X)
  437.  
  438.  - Function: ZEROEQUIV (exp,var)
  439.      tests whether the expression exp in the variable var is equivalent
  440.      to zero.  It returns either TRUE, FALSE, or DONTKNOW.  For example
  441.      ZEROEQUIV(SIN(2*X) - 2*SIN(X)*COS(X),X) returns TRUE and
  442.      ZEROEQUIV(%E^X+X,X) returns FALSE.  On the other hand
  443.      ZEROEQUIV(LOG(A*B) - LOG(A) - LOG(B),A) will return DONTKNOW
  444.      because of the presence of an extra parameter.  The restrictions
  445.      are: (1) Do not use functions that MACSYMA does not know how to
  446.      differentiate and evaluate.  (2) If the expression has poles on
  447.      the real line, there may be errors in the result (but this is
  448.      unlikely to occur).  (3) If the expression contains functions
  449.      which are not solutions to first order differential equations
  450.      (e.g.  Bessel functions) there may be incorrect results.  (4) The
  451.      algorithm uses evaluation at randomly chosen points for carefully
  452.      selected subexpressions.  This is always a somewhat hazardous
  453.      business, although the algorithm tries to minimize the potential
  454.      for error.
  455.  
  456.  
  457. 
  458. File: maxima.info,  Node: Expressions,  Next: Simplification,  Prev: Operators,  Up: Top
  459.  
  460. Expressions
  461. ***********
  462.  
  463. * Menu:
  464.  
  465. * Introduction to Expressions::
  466. * ASSIGNMENT::
  467. * COMPLEX::
  468. * INEQUALITY::
  469. * SYNTAX::
  470. * Definitions for Expressions::
  471.  
  472. 
  473. File: maxima.info,  Node: Introduction to Expressions,  Next: ASSIGNMENT,  Prev: Expressions,  Up: Expressions
  474.  
  475. Introduction to Expressions
  476. ===========================
  477.  
  478.    There are a number of reserved words which cannot be used as
  479. variable names.   Their use would cause a possibly cryptic syntax error.
  480.  
  481.      INTEGRATE            NEXT           FROM                 DIFF
  482.      IN                   AT             LIMIT                SUM
  483.      FOR                  AND            ELSEIF               THEN
  484.      ELSE                 DO             OR                   IF
  485.      UNLESS               PRODUCT        WHILE                THRU
  486.      STEP
  487.  
  488.    Most things in MAXIMA are expressions.   A sequence of expressions
  489. can be made into an expression by separating them by commas and putting
  490. parentheses around them.   This is similar to the C comma expression.
  491.  
  492.      (C29) x:3$
  493.      (C30) joe:(x:x+1,x:x*x);
  494.      (D30) 16
  495.      (C31) joe:(if (x >17) then 2 else 4);
  496.      (D31) 4
  497.      (C32) joe:(if (x >17) then x:2 else joe:4,joe+x);
  498.      (D32) 20
  499.  
  500.    Even loops in maxima are expressions, although the value they return
  501. is the not too useful `DONE'
  502.  
  503.      (C33) joe:(x:1,for i from 1 thru 10 do (x:x*i));
  504.      (D33) DONE
  505.    whereas what you really want is probably to include a third term in
  506. the comma expression which actually gives back the value.
  507.  
  508.      (C34) joe:(x:1,for i from 1 thru 10 do (x:x*i),x);
  509.      (D34) 3628800
  510.  
  511. 
  512. File: maxima.info,  Node: ASSIGNMENT,  Next: COMPLEX,  Prev: Introduction to Expressions,  Up: Expressions
  513.  
  514. ASSIGNMENT
  515. ==========
  516.  
  517.    - There are two assignment operators in MACSYMA, : and :: .  E.g.
  518. A:3 sets the variable A to 3.  :: assigns the value of the expression
  519. on its right to the value of the quantity on its left, which must
  520. evaluate to an atomic variable or subscripted variable.
  521.  
  522. 
  523. File: maxima.info,  Node: COMPLEX,  Next: INEQUALITY,  Prev: ASSIGNMENT,  Up: Expressions
  524.  
  525. COMPLEX
  526. =======
  527.  
  528.    - A complex expression is specified in MACSYMA by adding the real
  529. part of the expression to %I times the imaginary part.  Thus the roots
  530. of the equation X^2-4*X+13=0 are 2+3*%I and 2-3*%I.  Note that
  531. simplification of products of complex expressions can be effected by
  532. expanding the product.  Simplification of quotients, roots, and other
  533. functions of complex expressions can usually be accomplished by using
  534. the REALPART, IMAGPART, RECTFORM, POLARFORM, ABS, CARG functions.
  535.  
  536. 
  537. File: maxima.info,  Node: INEQUALITY,  Next: SYNTAX,  Prev: COMPLEX,  Up: Expressions
  538.  
  539. INEQUALITY
  540. ==========
  541.  
  542.    - MACSYMA has the usual inequality operators: less than:  < greater
  543. than:  > greater than or equal to:  >= less than or equal to:  <=
  544.  
  545. 
  546. File: maxima.info,  Node: SYNTAX,  Next: Definitions for Expressions,  Prev: INEQUALITY,  Up: Expressions
  547.  
  548. SYNTAX
  549. ======
  550.  
  551.    - It is possible to add new operators to MACSYMA (infix, prefix,
  552. postfix, unary, or matchfix with given precedences), to remove existing
  553. operators, or to redefine the precedence of existing operators.  While
  554. MACSYMA's syntax should be adequate for most ordinary applications, it
  555. is possible to define new operators or eliminate predefined ones that
  556. get in the user's way.  The extension mechanism is rather
  557. straightforward and should be evident from the examples below.
  558.      (C1) PREFIX("DDX")$
  559.      (C2) DDX Y$
  560.           /* means                   "DDX"(Y) */
  561.      (C3) INFIX("<-")$
  562.      (C4) A<-DDX Y$
  563.          /* means               "<-"(A,"DDX"(Y)) */
  564.    For each of the types of operator except SPECIAL, there is a
  565. corresponding creation function that will give the lexeme specified the
  566. corresponding parsing properties.  Thus "PREFIX("DDX")" will make "DDX"
  567. a prefix operator just like "-" or "NOT".  Of course, certain extension
  568. functions require additional information such as the matching keyword
  569. for a matchfix operator.  In addition, binding powers and parts of
  570. speech must be specified for all keywords defined.  This is done by
  571. passing additional arguments to the extension functions.  If a user
  572. does not specify these additional parameters, MACSYMA will assign
  573. default values.  The six extension functions with binding powers and
  574. parts of speech defaults (enclosed in brackets) are summarized below.
  575. PREFIX(operator, rbp[180], rpos[ANY], pos[ANY]) POSTFIX(operator,
  576. lbp[180], lpos[ANY], pos[ANY]) INFIX(operator, lbp[180], rbp[180],
  577. lpos[ANY], rpos[ANY],pos[ANY]) NARY(operator, bp[180], argpos[ANY],
  578. pos[ANY]) NOFIX(operator, pos[ANY]) MATCHFIX(operator, match,
  579. argpos[ANY], pos[ANY])     The defaults have been provided so that a
  580. user who does not wish to concern himself with parts of speech or
  581. binding powers may simply omit those arguments to the extension
  582. functions.  Thus the following are all equivalent.
  583. PREFIX("DDX",180,ANY,ANY)$ PREFIX("DDX",180)$ PREFIX("DDX")$     It is
  584. also possible to remove the syntax properties of an operator by using
  585. the functions REMOVE or KILL.  Specifically, "REMOVE("DDX",OP)" or
  586. "KILL("DDX")" will return "DDX" to operand status; but in the second
  587. case all the other properties of "DDX" will also be removed.
  588.  
  589.  
  590.      (C20) PREFIX("DDX",180,ANY,ANY)$
  591.      
  592.      (C21) DDXYZ;
  593.      
  594.      (D21)                     DDX YZ
  595.      
  596.      (C26) "ddx"(u):=u+4;
  597.      
  598.      (D26)                     DDX u := u + 4
  599.      (C27) ddx 8;
  600.      
  601.      (D27)                       12
  602.  
  603. 
  604. File: maxima.info,  Node: Definitions for Expressions,  Prev: SYNTAX,  Up: Expressions
  605.  
  606. Definitions for Expressions
  607. ===========================
  608.  
  609.  - Function: AT (exp, list)
  610.      will evaluate exp (which may be any expression) with the variables
  611.      assuming the values as specified for them in the list of equations
  612.      or the single equation similar to that given to the ATVALUE
  613.      function.  If a subexpression depends on any of the variables in
  614.      list but it hasn't had an atvalue specified and it can't be
  615.      evaluated then a noun form of the AT will be returned which will
  616.      display in a two-dimensional form.  Do EXAMPLE(AT); for an example.
  617.  
  618.  
  619.  - Function: BOX (expr)
  620.      returns expr enclosed in a box.  The box is actually part of the
  621.      expression.
  622.           BOX(expr,label)
  623.      encloses expr in a labelled box.  label is a name which will be
  624.      truncated in display if it is too long.      BOXCHAR["] - is the
  625.      character used to draw the box in this and in the DPART and LPART
  626.      functions.
  627.  
  628.  
  629.  - Variable: BOXCHAR
  630.      default: ["] is the character used to draw the box in the BOX and
  631.      in the DPART and LPART functions.
  632.  
  633.  
  634.  - special operator: CONSTANT
  635.      - makes ai a constant as is %PI.
  636.  
  637.  
  638.  - Function: CONSTANTP (exp)
  639.      is TRUE if exp is a constant (i.e.  composed of numbers and %PI,
  640.      %E, %I or any variables bound to a constant or DECLAREd constant)
  641.      else FALSE.  Any function whose arguments are constant is also
  642.      considered to be a constant.
  643.  
  644.  
  645.  - Function: CONTRACT (exp)
  646.      carries out all possible contractions in exp, which may be any
  647.      well-formed combination of sums and products.  This function uses
  648.      the information given to the DEFCON function.  Since all tensors
  649.      are considered to be symmetric in all indices, the indices are
  650.      sorted into alphabetical order.  Also all dummy indices are
  651.      renamed using the symbols !1,!2,... to permit the expression to be
  652.      simplified as much as possible by reducing equivalent terms to a
  653.      canonical form.  For best results exp should be fully expanded.
  654.      RATEXPAND is the fastest way to expand products and powers of sums
  655.      if there are no variables in the denominators of the terms.  The
  656.      GCD switch should be FALSE if gcd cancellations are unnecessary.
  657.  
  658.  
  659.  - Function: DECLARE (a1, f1, a2, f2, ...)
  660.      gives the atom ai the flag fi.  The ai's and fi's may also be
  661.      lists of atoms and flags respectively in which case each of the
  662.      atoms gets all of the properties.  The possible flags and their
  663.      meanings are:
  664.  
  665.      CONSTANT - makes ai a constant as is %PI.
  666.  
  667.      MAINVAR - makes ai a MAINVAR.  The ordering scale for atoms:
  668.      numbers < constants (e.g. %E,%PI) < scalars < other variables <
  669.      mainvars.
  670.  
  671.      SCALAR - makes ai a scalar.
  672.  
  673.      NONSCALAR - makes ai behave as does a list or matrix with respect
  674.      to the dot operator.
  675.  
  676.      NOUN - makes the function ai a noun so that it won't be evaluated
  677.      automatically.
  678.  
  679.      EVFUN - makes ai known to the EV function so that it will get
  680.      applied if its name is mentioned.  Initial evfuns are
  681.           FACTOR, TRIGEXPAND,
  682.           TRIGREDUCE, BFLOAT, RATSIMP, RATEXPAND, and RADCAN
  683.  
  684.      EVFLAG - makes ai known to the EV function so that it will be
  685.      bound to TRUE during the execution of EV if it is mentioned.
  686.      Initial evflags are
  687.           FLOAT, PRED, SIMP, NUMER, DETOUT, EXPONENTIALIZE, DEMOIVRE,
  688.           KEEPFLOAT, LISTARITH, TRIGEXPAND, SIMPSUM, ALGEBRAIC,
  689.           RATALGDENOM, FACTORFLAG, %EMODE, LOGARC, LOGNUMER,
  690.           RADEXPAND, RATSIMPEXPONS, RATMX, RATFAC, INFEVAL, %ENUMER,
  691.           PROGRAMMODE, LOGNEGINT, LOGABS, LETRAT, HALFANGLES,
  692.           EXPTISOLATE, ISOLATE_WRT_TIMES, SUMEXPAND, CAUCHYSUM,
  693.           NUMER_PBRANCH, M1PBRANCH, DOTSCRULES, and LOGEXPAND
  694.  
  695.      BINDTEST - causes ai to signal an error if it ever is used in a
  696.      computation unbound.  DECLARE([var1, var2, ...], BINDTEST) causes
  697.      MACSYMA to give an error message whenever any of the vari occur
  698.      unbound in a computation.  MACSYMA currently recognizes and uses
  699.      the following features of objects:
  700.           EVEN, ODD, INTEGER, RATIONAL, IRRATIONAL, REAL, IMAGINARY,
  701.           and COMPLEX
  702.      he useful features of functions include:
  703.            INCREASING,
  704.           DECREASING, ODDFUN (odd function), EVENFUN (even function),
  705.           COMMUTATIVE (or SYMMETRIC), ANTISYMMETRIC, LASSOCIATIVE and
  706.           RASSOCIATIVE
  707.      DECLARE(F,INCREASING) is in all respects equivalent to
  708.  
  709.           ASSUME(KIND(F,INCREASING))
  710.      The ai and fi may also be lists of objects or features.  The
  711.      command
  712.           FEATUREP(object,feature)
  713.      may be used to determine if an object has been DECLAREd to have
  714.      "feature".  See DESCRIBE(FEATURES); .
  715.  
  716.  
  717.  - Function: DISOLATE (exp, var1, var2, ..., varN)
  718.      is similar to ISOLATE(exp, var) (Do DESCRIBE(ISOLATE);) except
  719.      that it enables the user to isolate more than one variable
  720.      simultaneously.  This might be useful, for example, if one were
  721.      attempting to change variables in a multiple integration, and that
  722.      variable change involved two or more of the integration variables.
  723.      This function is autoloaded from `simplification/disol.mac'.  A
  724.      demo is available by `demo("disol")$'.
  725.  
  726.  
  727.  - Function: DISPFORM (exp)
  728.      returns the external representation of exp (wrt its main
  729.      operator).  This should be useful in conjunction with PART which
  730.      also deals with the external representation.  Suppose EXP is -A .
  731.      Then the internal representation of EXP is "*"(-1,A), while the
  732.      external representation is "-"(A). DISPFORM(exp,ALL) converts the
  733.      entire expression (not just the top-level) to external format.  For
  734.      example, if EXP:SIN(SQRT(X)), then FREEOF(SQRT,EXP) and
  735.      FREEOF(SQRT,DISPFORM(EXP)) give TRUE, while
  736.      FREEOF(SQRT,DISPFORM(EXP,ALL)) gives FALSE.
  737.  
  738.  
  739.  - Function: DISTRIB (exp)
  740.      distributes sums over products.  It differs from EXPAND in that it
  741.      works at only the top level of an expression, i.e. it doesn't
  742.      recurse and it is faster than EXPAND.  It differs from MULTTHRU in
  743.      that it expands all sums at that level. For example,
  744.      DISTRIB((A+B)*(C+D)) -> A C + A D + B C + B D MULTTHRU
  745.      ((A+B)*(C+D)) -> (A + B) C + (A + B) D DISTRIB (1/((A+B)*(C+D)))
  746.      ->  1/ ((A+B) *(C+D)) EXPAND(1/((A+B)*(C+D)),1,0) -> 1/(A C + A D
  747.      + B C + B D)
  748.  
  749.  
  750.  - Function: DPART (exp, n1, ..., nk)
  751.      selects the same subexpression as PART, but instead of just
  752.      returning that subexpression as its value, it returns the whole
  753.      expression with the selected subexpression displayed inside a box.
  754.      The box is actually part of the expression.
  755.           (C1) DPART(X+Y/Z**2,1,2,1);
  756.                                  Y
  757.           (D1)                  ---- + X
  758.                                    2
  759.                                *****
  760.                                * Z *
  761.                                *****
  762.  
  763.  - Function: EXP (X)
  764.      the exponential function.  It is represented internally as %E^X.
  765.      DEMOIVRE[FALSE] - if TRUE will cause %E^(A+B*%I) to become
  766.      %E^A*(COS(B)+%I*SIN(B)) if B is free of %I.  A and B are not
  767.      expanded.    %EMODE[TRUE] - when TRUE %E^(%PI*%I*X) will be
  768.      simplified as follows: it will become COS(%PI*X)+%I*SIN(%PI*X) if
  769.      X is an integer or a multiple of 1/2, 1/3, 1/4, or 1/6 and thus
  770.      will simplify further.  For other numerical X it will become
  771.      %E^(%PI*%I*Y) where Y is X-2*k for some integer k such that
  772.      ABS(Y)<1.  If %EMODE is FALSE no simplification of %E^(%PI*%I*X)
  773.      will take place.    %ENUMER[FALSE] - when TRUE will cause %E to be
  774.      converted into 2.718...  whenever NUMER is TRUE.  The default is
  775.      that this conversion will take place only if the exponent in %E^X
  776.      evaluates to a number.
  777.  
  778.  
  779.  - Variable: EXPTISOLATE
  780.      default: [FALSE] if TRUE will cause ISOLATE(expr,var); to examine
  781.      exponents of atoms (like %E) which contain var.
  782.  
  783.  
  784.  - Variable: EXPTSUBST
  785.      default: [FALSE] if TRUE permits substitutions such as Y for %E**X
  786.      in %E**(A*X) to take place.
  787.  
  788.  
  789.  - Function: FREEOF (x1, x2, ..., exp)
  790.      yields TRUE if the xi do not occur in exp and FALSE otherwise.
  791.      The xi are atoms or they may be subscripted names, functions (e.g.
  792.      SIN(X) ), or operators enclosed in "s.  If 'var' is a "dummy
  793.      variable" of 'exp', then FREEOF(var,exp); will return TRUE.
  794.      "Dummy variables" are mathematical things like the index of a sum
  795.      or product, the limit variable, and the definite integration
  796.      variable.  Example: FREEOF(I,'SUM(F(I),I,0,N)); returns TRUE.  Do
  797.      EXAMPLE(FREEOF); for more examples.
  798.  
  799.  
  800.  - Function: GENFACT (X, Y, Z)
  801.      is the generalized factorial of X which is:
  802.      X*(X-Z)*(X-2*Z)*...*(X-(Y-1)*Z).  Thus, for integral X,
  803.      GENFACT(X,X,1)=X!  and GENFACT(X,X/2,2)=X!!
  804.  
  805.  
  806.  - Function: IMAGPART (exp)
  807.      returns the imaginary part of the expression exp.
  808.  
  809.  
  810.  - Function: INDICES (exp)
  811.      returns a list of two elements.  The first is a list of the free
  812.      indices in exp (those that occur only once); the second is the
  813.      list of dummy indices in exp (those that occur exactly twice).
  814.  
  815.  
  816.  - Function: INFIX (op)
  817.      - INFIX operators are used to denote functions of two arguments,
  818.      one given before the operator and one after, e.g. A^2 .  The
  819.      INFIX("x") function is a syntax extention function to declare x to
  820.      be an INFIX operator.  Do DESCRIBE(SYNTAX); for more details.
  821.  
  822.  
  823.  - Variable: INFLAG
  824.      default: [FALSE] if set to TRUE, the functions for part extraction
  825.      will look at the internal form of exp.  Note that the simplifier
  826.      re-orders expressions.  Thus FIRST(X+Y) will be X if INFLAG is
  827.      TRUE and Y if INFLAG is FALSE.  (FIRST(Y+X) gives the same
  828.      results).  Also, setting INFLAG to TRUE and calling PART/SUBSTPART
  829.      is the same as calling INPART/SUBSTINPART.  Functions affected by
  830.      the setting of INFLAG are: PART, SUBSTPART, FIRST, REST, LAST,
  831.      LENGTH, the FOR ... IN construct, MAP, FULLMAP, MAPLIST, REVEAL
  832.      and PICKAPART.
  833.  
  834.  
  835.  - Function: INPART (exp, n1, ..., nk)
  836.      is similar to PART but works on the internal representation of the
  837.      expression rather than the displayed form and thus may be faster
  838.      since no formatting is done.  Care should be taken with respect to
  839.      the order of subexpressions in sums and products (since the order
  840.      of variables in the internal form is often different from that in
  841.      the displayed form) and in dealing with unary minus, subtraction,
  842.      and division (since these operators are removed from the
  843.      expression). PART(X+Y,0) or INPART(X+Y,0) yield +, though in order
  844.      to refer to the operator it must be enclosed in "s.  For example
  845.      ...IF INPART(D9,0)="+" THEN ...
  846.           (C1)  X+Y+W*Z;
  847.           (D1)                  W Z + Y + X
  848.           (C2)  INPART(D1,3,2);
  849.           (D2)                  Z
  850.           (C3)  PART(D1,1,2);
  851.           (D3)                  Z
  852.           (C4) 'LIMIT(F(X)**G(X+1),X,0,MINUS);
  853.                                                 G(X + 1)
  854.           (D4)                      LIMIT   F(X)
  855.                                     X ->0-
  856.           (C5) INPART(%,1,2);
  857.           (D5)                            G(X + 1)
  858.  
  859.  - Function: ISOLATE (exp, var)
  860.      returns exp with subexpressions which are sums and which do not
  861.      contain var replaced by intermediate expression labels (these
  862.      being atomic symbols like E1, E2, ...).  This is often useful to
  863.      avoid unnecessary expansion of subexpressions which don't contain
  864.      the variable of interest.  Since the intermediate labels are bound
  865.      to the subexpressions they can all be substituted back by
  866.      evaluating the expression in which they occur.  EXPTISOLATE[FALSE]
  867.      if TRUE will cause ISOLATE to examine exponents of atoms (like %E)
  868.      which contain var.  ISOLATE_WRT_TIMES[FALSE] if TRUE, then ISOLATE
  869.      will also isolate wrt products.  E.g. compare both settings of the
  870.      switch on ISOLATE(EXPAND((A+B+C)^2),C); .  Do EXAMPLE(ISOLATE);
  871.      for examples.
  872.  
  873.  
  874.  - Variable: ISOLATE_WRT_TIMES
  875.      default: [FALSE] - if set to TRUE, then ISOLATE will also isolate
  876.      wrt products.  E.g. compare both settings of the switch on
  877.      ISOLATE(EXPAND((A+B+C)^2),C); .
  878.  
  879.  
  880.  - Variable: LISTCONSTVARS
  881.      default: [FALSE] - if TRUE will cause LISTOFVARS to include %E,
  882.      %PI, %I, and any variables declared constant in the list it
  883.      returns if they appear in the expression LISTOFVARS is called on.
  884.      The default is to omit these.
  885.  
  886.  
  887.  - Variable: LISTDUMMYVARS
  888.      default: [TRUE] - if FALSE, "dummy variables" in the expression
  889.      will not be included in the list returned by LISTOFVARS.  (The
  890.      meaning of "dummy variables" is as given in DESCRIBE(FREEOF):
  891.      "Dummy variables" are mathematical things like the index of a sum
  892.      or product, the limit variable, and the definite integration
  893.      variable.)  Example: LISTOFVARS('SUM(F(I),I,0,N)); gives [I,N] if
  894.      LISTDUMMYVARS is TRUE, and [N] if LISTDUMMYVARS is FALSE.
  895.  
  896.  
  897.  - Function: LISTOFVARS (exp)
  898.      yields a list of the variables in exp.  LISTCONSTVARS[FALSE] if
  899.      TRUE will cause LISTOFVARS to include %E, %PI, %I, and any
  900.      variables declared constant in the list it returns if they appear
  901.      in exp.  The default is to omit these.
  902.           (C1) LISTOFVARS(F(X[1]+Y)/G**(2+A));
  903.           (D1)                            [X[1], Y, A, G]
  904.  
  905.  - Function: LFREEOF (list, exp)
  906.      For each member m of list, calls FREEOF(m,exp).  It returns false
  907.      if any call to FREEOF does and true otherwise.
  908.  
  909.  - Function: LOPOW (exp, v)
  910.      the lowest exponent of v which explicitly appears in exp.  Thus
  911.  
  912.           LOPOW((X+Y)**2+(X+Y)**A,X+Y) ==> MIN(A,2)
  913.      .
  914.  
  915.  
  916.  - Function: LPART (label, expr, n1, ..., nk)
  917.      is similar to DPART but uses a labelled box. A labelled box is
  918.      similar to the one produced by DPART but it has a name in the top
  919.      line.
  920.  
  921.  
  922.  - Function: MULTTHRU (exp)
  923.      multiplies a factor (which should be a sum) of exp by the other
  924.      factors of exp.  That is exp is f1*f2*...*fn where at least one
  925.      factor, say fi, is a sum of terms.  Each term in that sum is
  926.      multiplied by the other factors in the product.  (Namely all the
  927.      factors except fi).  MULTTHRU does not expand exponentiated sums.
  928.      This function is the fastest way to distribute products
  929.      (commutative or noncommutative) over sums.  Since quotients are
  930.      represented as products MULTTHRU can be used to divide sums by
  931.      products as well.  MULTTHRU(exp1, exp2) multiplies each term in
  932.      exp2 (which should be a sum or an equation) by exp1.  If exp1 is
  933.      not itself a sum then this form is equivalent to
  934.      MULTTHRU(exp1*exp2).
  935.           (C1) X/(X-Y)**2-1/(X-Y)-F(X)/(X-Y)**3;
  936.                          1        X         F(X)
  937.           (D1)       - ----- + -------- - --------
  938.                        X - Y          2          3
  939.                                (X - Y)    (X - Y)
  940.           (C2) MULTTHRU((X-Y)**3,%);
  941.                               2
  942.           (D2)       - (X - Y)  + X (X - Y) - F(X)
  943.           (C3) RATEXPAND(D2);
  944.                                      2
  945.           (D3)                    - Y  + X Y - F(X)
  946.           (C4) ((A+B)**10*S**2+2*A*B*S+(A*B)**2)/(A*B*S**2);
  947.                                    10  2              2  2
  948.                           (B  + A )   S  + 2 A B S + A  B
  949.           (D4)            --------------------------------
  950.                                              2
  951.                                         A B S
  952.           (C5) MULTTHRU(%);
  953.                                                     10
  954.                                   2   A B   (B  + A)
  955.           (D5)                    - + --- + -------
  956.                                   S    2      A B
  957.                                       S
  958.           (notice that (B+A)**10 is not expanded)
  959.           (C6) MULTTHRU(A.(B+C.(D+E)+F));
  960.           (D6)                A . F + A . (C . (E + D)) + A . B
  961.           (compare with similar example under EXPAND)
  962.  
  963.  - Function: NOUNIFY (f)
  964.      returns the noun form of the function name f.  This is needed if
  965.      one wishes to refer to the name of a verb function as if it were a
  966.      noun.  Note that some verb functions will return their noun forms
  967.      if they can't be evaluated for certain arguments.  This is also
  968.      the form returned if a function call is preceded by a quote.
  969.  
  970.  
  971.  - Function: NTERMS (exp)
  972.      gives the number of terms that exp would have if it were fully
  973.      expanded out and no cancellations or combination of terms
  974.      occurred. Note that expressions like SIN(E), SQRT(E), EXP(E), etc.
  975.      count as just one term regardless of how many terms E has (if it
  976.      is a sum).
  977.  
  978.  
  979.  - Function: OP (exp)
  980.      Returns the operator of the expression, and functions the same way
  981.      as PART(exp,0).  It observes the setting of the INPART flag.  It
  982.      may not return the same value as the commercial Macsyma.
  983.  
  984.  
  985.  - Function: OPERATORP (exp, ool)
  986.      Uses OP to get the operator of the expression and either compares
  987.      it to ool, if it is a operator, or checks if it is a member of ool
  988.      if it is a list.
  989.  
  990.  
  991.  - Function: OPTIMIZE (exp)
  992.      returns an expression that produces the same value and side
  993.      effects as exp but does so more efficiently by avoiding the
  994.      recomputation of common subexpressions.  OPTIMIZE also has the side
  995.      effect of "collapsing" its argument so that all common
  996.      subexpressions are shared.  Do EXAMPLE(OPTIMIZE); for examples.
  997.  
  998.  
  999.  - Variable: OPTIMPREFIX
  1000.      default: [%] - The prefix used for generated symbols by the
  1001.      OPTIMIZE command.
  1002.  
  1003.  
  1004.  - Function: ORDERGREAT (V1, ..., Vn)
  1005.      sets up aliases for the variables V1, ..., Vn such that V1 > V2 >
  1006.      ...  > Vn > any other variable not mentioned as an argument.  See
  1007.      also ORDERLESS.  Caveat:  do EXAMPLE(ORDERGREAT); for some
  1008.      specifics.
  1009.  
  1010.  
  1011.  - Function: ORDERGREATP (exp1,exp2)
  1012.      returns TRUE if exp2 precedes exp1 in the ordering set up with the
  1013.      ORDERGREAT function (see DESCRIBE(ORDERGREAT);).
  1014.  
  1015.  
  1016.  - Function: ORDERLESS (V1, ..., Vn)
  1017.      sets up aliases for the variables V1, ..., Vn such that V1 < V2 <
  1018.      ...  < Vn < any other variable not mentioned as an argument.  Thus
  1019.      the complete ordering scale is: numerical constants < declared
  1020.      constants < declared scalars < first argument to ORDERLESS < ...
  1021.      < last argument to ORDERLESS < variables which begin with A < ...
  1022.      < variables which begin with Z < last argument to ORDERGREAT <
  1023.      ... < first argument to ORDERGREAT < declared MAINVARs.  Caveat: do
  1024.      EXAMPLE(ORDERLESS); for some specifics.  For another ordering
  1025.      scheme, see DESCRIBE(MAINVAR);.
  1026.  
  1027.  
  1028.  - Function: ORDERLESSP (exp1,exp2)
  1029.      returns TRUE if exp1 precedes exp2 in the ordering set up by the
  1030.      ORDERLESS command (see DESCRIBE(ORDERLESS);).
  1031.  
  1032.  
  1033.  - Function: PART (exp, n1, ..., nk)
  1034.      deals with the displayed form of exp. It obtains the part of exp
  1035.      as specified by the indices n1,...,nk.  First part n1 of exp is
  1036.      obtained, then part n2 of that, etc.  The result is part nk of ...
  1037.      part n2 of part n1 of exp.  Thus PART(Z+2*Y,2,1) yields 2.  PART
  1038.      can be used to obtain an element of a list, a row of a matrix, etc.
  1039.      If the last argument to a Part function is a list of indices then
  1040.      several subexpressions are picked out, each one corresponding to an
  1041.      index of the list.  Thus PART(X+Y+Z,[1,3]) is Z+X.  PIECE holds
  1042.      the last expression selected when using the Part functions.  It is
  1043.      set during the execution of the function and thus may be referred
  1044.      to in the function itself as shown below.  If PARTSWITCH[FALSE] is
  1045.      set to TRUE then END is returned when a selected part of an
  1046.      expression doesn't exist, otherwise an error message is given.
  1047.      For examples, do EXAMPLE(PART);
  1048.  
  1049.  
  1050.  - Function: PARTITION (exp, var)
  1051.      returns a list of two expressions.  They are (1) the factors of
  1052.      exp (if it is a product), the terms of exp (if it is a sum), or
  1053.      the list (if it is a list) which don't contain var and, (2) the
  1054.      factors, terms, or list which do.
  1055.           (C1) PARTITION(2*A*X*F(X),X);
  1056.           (D1)                 [ 2 A , X F(X) ]
  1057.           (C2) PARTITION(A+B,X);
  1058.           (D2)                 [ A + B , 0 ]
  1059.           (C3) PARTITION([A,B,F(A),C],A);
  1060.           (D3)                [[B,C],[A,F(A)]]
  1061.  
  1062.  - Variable: PARTSWITCH
  1063.      default: [FALSE] - if set to TRUE then END is returned when a
  1064.      selected part of an expression doesn't exist, otherwise an error
  1065.      message is given.
  1066.  
  1067.  
  1068.  - Function: PICKAPART (exp,depth)
  1069.      will assign E labels to all subexpressions of exp down to the
  1070.      specified integer depth.  This is useful for dealing with large
  1071.      expressions and for automatically assigning parts of an expression
  1072.      to a variable without having to use the part functions.
  1073.           (C1) EXP:(A+B)/2+SIN(X^2)/3-LOG(1+SQRT(X+1));
  1074.                                                            2
  1075.                                                       SIN(X )   B + A
  1076.           (D1)               - LOG(SQRT(X + 1) + 1) + ------- + -----
  1077.                                                          3        2
  1078.           (C2) PICKAPART(%,1);
  1079.           (E2)                    - LOG(SQRT(X + 1) + 1)
  1080.                                               2
  1081.                                          SIN(X )
  1082.           (E3)                           -------
  1083.                                             3
  1084.                                           B + A
  1085.           (E4)                            -----
  1086.                                             2
  1087.           (D4)                         E4 + E3 + E2
  1088.  
  1089.  - Variable: PIECE
  1090.      - holds the last expression selected when using the Part
  1091.      functions.  It is set during the execution of the function and thus
  1092.      may be referred to in the function itself.
  1093.  
  1094.  
  1095.  - Function: POWERS (expr, var)
  1096.      gives the powers of var occuring in expr.  To use it, do
  1097.      LOAD(POWERS);.  For details on usage, do PRINTFILE("powers.usg");.
  1098.  
  1099.  
  1100.  - Function: PRODUCT (exp, ind, lo, hi)
  1101.      gives the product of the values of exp as the index ind varies
  1102.      from lo to hi.  The evaluation is similar to that of SUM.  No
  1103.      simplification of products is available at this time.  If hi is
  1104.      one less than lo, we have an "empty product" and PRODUCT returns 1
  1105.      rather than erring out.  Also see DESCRIBE(PRODHACK).
  1106.           (C1)  PRODUCT(X+I*(I+1)/2,I,1,4);
  1107.           (D1)             (X + 1) (X + 3) (X + 6) (X + 10)
  1108.  
  1109.  - Function: REALPART (exp)
  1110.      gives the real part of exp. REALPART and IMAGPART will work on
  1111.      expressions involving trigonometic and hyperbolic functions, as
  1112.      well as SQRT, LOG, and exponentiation.
  1113.  
  1114.  
  1115.  - Function: RECTFORM (exp)
  1116.      returns an expression of the form A + B*%I, where A and B are
  1117.      purely real.
  1118.  
  1119.  
  1120.  - Function: REMBOX (expr, arg)
  1121.      removes boxes from expr according to arg.  If arg is UNLABELED
  1122.      then all unlabelled boxes are removed.  If arg is the name of some
  1123.      label then only boxes with that label are removed.  If arg is
  1124.      omitted then all boxes labelled and unlabelled are removed.
  1125.  
  1126.  
  1127.  - Function: SUM (exp, ind, lo, hi)
  1128.      performs a summation of the values of exp as the index ind varies
  1129.      from lo to hi.  If the upper and lower limits differ by an integer
  1130.      then each term in the sum is evaluated and added together.
  1131.      Otherwise, if the SIMPSUM [FALSE] is TRUE the result is
  1132.      simplified.  This simplification may sometimes be able to produce a
  1133.      closed form.  If SIMPSUM is FALSE or if 'SUM is used, the value is
  1134.      a sum noun form which is a representation of the sigma notation
  1135.      used in mathematics.  If hi is one less than lo, we have an "empty
  1136.      sum" and SUM returns 0 rather than erring out.  Sums may be
  1137.      differentiated, added, subtracted, or multiplied with some
  1138.      automatic simplification being performed.  Also see
  1139.      DESCRIBE(SUMHACK).  CAUCHYSUM[FALSE] when TRUE causes the Cauchy
  1140.      product to be used when multiplying sums together rather than the
  1141.      usual product.  In the Cauchy product the index of the inner
  1142.      summation is a function of the index of the outer one rather than
  1143.      varying independently.  GENINDEX[I] is the alphabetic prefix used
  1144.      to generate the next variable of summation.  GENSUMNUM[0] is the
  1145.      numeric suffix used to generate the next variable of summation.
  1146.      If it is set to FALSE then the index will consist only of GENINDEX
  1147.      with no numeric suffix.  Do EXAMPLE(SUM); for examples.  See also
  1148.      SUMCONTRACT, INTOSUM, BASHINDICES, and NICEINDICES.
  1149.  
  1150.  
  1151.  - Function: LSUM (exp, ind, list)
  1152.      performs the sum of EXP for each element IND of the LIST.
  1153.           (C10) lsum(x^i,i,[1,2,7]);
  1154.           
  1155.                                       7    2
  1156.           (D10)                      x  + x  + x
  1157.      If the last element LIST argument does not evaluate, or does not
  1158.      evaluate to a Maxima list then the answer is left in noun form
  1159.           (C13) lsum(i^2,i,rootsof(x^3-1));
  1160.           
  1161.                                ====
  1162.                                \      2
  1163.           (D13)                 >    i
  1164.                                /
  1165.                                ====
  1166.                                              3
  1167.                                i in ROOTSOF(x  - 1)
  1168.  
  1169.  
  1170.  - special symbol: VERB
  1171.      - the opposite of "noun", i.e. a function form which "does
  1172.      something" ("action" - for most functions the usual case).  E.g.
  1173.      INTEGRATE integrates a function, unless it is DECLAREd to be a
  1174.      "noun", in which case it represents the INTEGRAL of the function.
  1175.      See NOUN, NOUNIFY, and VERBIFY.
  1176.  
  1177.  
  1178.  - Function: VERBIFY (f)
  1179.      returns the function name f in its verb form (See also VERB, NOUN,
  1180.      and NOUNIFY).
  1181.  
  1182.  
  1183.